<?php
!function_exists('zeai_alone') && exit('Forbidden!');
$photo_s_url = (!empty($cook_photo_s))?UP.$cook_photo_s:RES.'my_m'.$cook_sex.'.png';
$maxg=$def_grade;
$maxif2=$def_if2;
?>
<!doctype html><html><head><meta charset="utf-8">
<title>VIP收银台-<?php echo $_ZEAI['siteName'];?></title>
<?php echo HEADMETA; ?>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/my_vip2.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo RES;?>m/css/my_vip2.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo HOST;?>/cache/zeaicolor.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>#backtop a{background-color:#fff;color:<?php echo $_ZEAI['mob_mbcolor'];?>}</style>
<?php
$wxshareT   = 'VIP收银台';
$wxshareC   = '开通VIP，畅通无极限，享受红娘一对一人工服务！';
$wxshareURL = mHref('vip');
$wxsharePIC = RES.'m/img/share_vip.png?'.$_ZEAI['cache_str'];
if (is_weixin()){
	require_once ZEAI."api/weixin/jssdk.php";?>
	<script src="<?php echo RES; ?>jweixin-1.2.0.js"></script>
	<script>
	wx.config({debug:false,appId: '<?php echo $signPackage["appId"];?>',timestamp: <?php echo $signPackage["timestamp"];?>,nonceStr:'<?php echo $signPackage["nonceStr"];?>',signature: '<?php echo $signPackage["signature"];?>',jsApiList:['hideMenuItems','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','previewImage']});
	var FX_title = '<?php echo trimhtml($wxshareT);?>',
	FX_desc  = '<?php echo trimhtml($wxshareC).'【'.$_ZEAI['siteName'].'】';?>',
	FX_link  = '<?php echo $wxshareURL; ?>',
	FX_imgurl= '<?php echo $wxsharePIC; ?>';
	wx.ready(function () {
		wx.onMenuShareAppMessage({title:FX_title,desc:FX_desc,link:FX_link,imgUrl:FX_imgurl});
		wx.onMenuShareTimeline({title:FX_title,link:FX_link,imgUrl:FX_imgurl});
	});
	</script>
<?php }?>
</head>
<body>
<?php
$mini_class='top_mini4';
$mini_L = '<em onClick="'.$jumpurlback.'"><i class="ico" >&#xe602;</i></em>';
$mini_title='<img src="'.$photo_s_url.'">'.$cook_nickname;
require_once ZEAI.'m/top_mini.php';?>
<div style="height:5rem"></div>
<div class="my_vip_self">您当前：<?php echo utitle($cook_grade);?><?php if($cook_grade>1)echo '（'.YmdHis($cook_sjtime,'Ymd').'~'.YmdHis($cook_sjtime2,'Ymd').'）';?></div>
<?php if ($ifpay){?>
    <div class="viplist">
        <div class="zdcon">
            <ul>
				<?php
                foreach($urole as $RV){
                    $g = $RV['g'];$f = $RV['f'];
                    $if2 = $RV['if2'];
                    if($g<=1 || $f!=1)continue;
                    //if($cook_grade > $g )continue;
                    $pic_url = UP.'p/img/grade'.$cook_sex.$g.'.png?'.$_ZEAI['cache_str'];
                    $price = ($cook_sex==2)?$sj_rmb2[$g.'_'.$if2]:$sj_rmb1[$g.'_'.$if2];
                    $dayprice=round($price/$if2,2);
                    $dayprice=($dayprice>0)?' 仅'.$dayprice.'元/天':'';?>
					<li<?php echo ($def_grade == $g)?' class="vipli ed"':' class="vipli"';?> onClick="vipFn(this,<?php echo $g;?>,<?php echo $if2;?>,encodeURIComponent('<?php echo '开通'.utitle($g).$if2.'天'; ?>'),<?php echo $price;?>)"><img src="<?php echo $pic_url;?>"><h1><?php echo utitle($g); ?></h1><h2><?php echo $if2;?>天</h2><h3><?php echo $price;?></h3><h4><?php echo $dayprice;?></h4></li>
					<?php
				}?>
            </ul>
        </div>
    </div>
    <div class="clear"></div>
    <button type="button" class="btn size4 yuan B" id="vipbtn">确认购买</button>
<?php }else{ ?>
    	<div class="viplist viplistNO"><br><br><?php echo $vipclosestr;?><br>
        	<div class="my-subscribe_box" style="display:block"><img src="<?php echo UP.$kf_wxpic;?>" style="width:30%"><h3>加客服微信人工咨询<br><br><br><br></h3></div>
        </div>
<?php }?>
<div class="vipC">
    <h1>套餐说明</h1>
    <div class="CC" id="vipC"></div>
</div>
<div class="vipBNR">
    <h1>专享特权</h1>
	<ul id="ul" class="auth"></ul>
	<div class="icobg ico">&#xe611;</div>
    <i class="ico off morebtn2" onClick="morebtn(this);">展开更多特权 &#xe60b;</i>
</div>
<?php if ($ifpay){?>
    <input type="hidden" name="grade" id="grade" value="<?php echo $def_grade;?>">
    <input type="hidden" name="if2" id="if2" value="<?php echo $def_if2;?>">
    <script>
    var maxg=<?php echo $maxg;?>;
    vipbtn.onclick=function(){
        if (!zeai.ifint(grade.value) || !zeai.ifint(if2.value) ){zeai.msg('请选择VIP类型');return false;}
		if (o('money').value<=0){zeai.msg('请选择');return false;}
		zeai.ajax({url:HOST+'/m/my_vip'+zeai.extname,data:{submitok:'ajax_chk_vipnum',grade:grade.value}},function(e){var rs=zeai.jsoneval(e);
			if(rs.flag==1){
				money=o('money').value;o('money_str').html('￥'+money);
				ZeaiM.div_up({obj:czbox,h:<?php echo (is_weixin())?30.5:37.5;?>});
				if(cook_money >= o('money').value && cook_money>0){
					o('rmbbox').class('on');
					o('money_tips').html('可用余额￥'+cook_money);
					o('rmbpay').disabled="";
					rmbpay.onclick = function(){
						paykind.value = 'rmbpay';
						payListener(this);
					}
				}else{
					o('rmbbox').class('off');
					o('money_tips').html('当前￥'+cook_money+'，账户余额不足');
					o('rmbpay').disabled="true";
					o('rmbpay').checked=false;
				}
			}else{
				zeai.msg(rs.msg,{time:5});
			}
		});
    }
    setTimeout(function(){getvipauth(<?php echo $maxg;?>);},600);
    document.body.onscroll = supdes_vip;
    </script>
    <?php
		$jump_url = (!empty($jumpurl))?urldecode($jumpurl):HOST.'/m/my.php';
		$money = $def_price;
		$kind  = 1;
		echo '<input type="hidden" id="money" value="'.$money.'">';
		require_once 'my_pay.php';?>
<?php }?>
<script>setTimeout(function(){getvipauth(<?php echo $def_grade;?>);},100);</script>
<div id="backtop"><a href="#top" id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<div class="blank"></div>
<?php 
if($_ZEAI['m_mb']==2){
	require_once ZEAI.'m/bottom2.php';
}else{
	require_once ZEAI.'m/bottom.php';
}
?>